const http = require("http");
const fs = require("fs");
const server =http.createServer((req,res)=>{
    console.log(req.url);
    if (req.url == "/") { // 路由地址
     let data =   fs.readFileSync('./views/index.html')
     res.write(data)
        res.end()
    }else if(req.url == "/product"){
        let data =   fs.readFileSync('./views/product.html')
        res.write(data)
           res.end()

    }
})


server.listen(8080);